package com.example.mapper;

import com.example.entity.Homework;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 陈昌吉
 * @since 2024-04-16
 */
@Mapper
public interface HomeworkMapper extends BaseMapper<Homework> {

    @Select("SELECT * from homework ORDER BY hid desc ")
    List<Homework> getWork();

    @Insert("insert into homework(name,starttime,endtime,content) values (#{name},#{starttime},#{endtime},#{content})")
    void add(Homework homework);
}
